package com.it.controller;

import com.it.entity.reopen.AiClaimReopen;
import com.it.service.AiClaimReopenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import utils.R;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lutao
 * @since 2025年09月22日
 */
@RestController
@RequestMapping("/aiClaimReopen")
public class AiClaimReopenController {

    @Autowired
    private AiClaimReopenService aiClaimReopenService;

    //增加重开赔案表数据
    @PutMapping("/reopenAdd")
    public R reopenAdd(@RequestBody AiClaimReopen aiClaimReopen){
        return R.Success(aiClaimReopenService.add(aiClaimReopen));
    }

    //查询重开赔案表(待审核)数据
    @GetMapping("/reopenList")
    public R reopenList(@RequestParam(value = "pageNum",required = false,defaultValue = "1") int pageNum,
                        @RequestParam(value = "pageSize",required = false,defaultValue = "5")int pageSize,
                        @RequestParam(value = "policyId",required = false)String policyId,
                        @RequestParam(value = "reportNo",required = false)String reportNo,
                        @RequestParam(value = "approveStatus",required = false)Integer approveStatus){
        return R.Success(aiClaimReopenService.selectReopenList(pageNum,pageSize,policyId,reportNo,approveStatus));
    }

    //更新重开赔案表数据/更改审核状态/更改调度表状态
    @PutMapping("/updateReopen")
    public R updateReopen(@RequestBody AiClaimReopen aiClaimReopen){
        return R.Success(aiClaimReopenService.updateByReportNo(aiClaimReopen));
    }

}
